package gameobjects.enemies
{
	import com.greensock.TweenMax;
	
	import flash.display.Sprite;
	
	import gameobjects.Enemy;

	public class Creep1 extends Enemy
	{
		private var myMovie:Enemy1 = new Enemy1();
		
		public function Creep1()
		{
			super(40, 2, 120);
			
			graphic.addChild(myMovie);
			
			graphic.y = -8;
			
			addChild(graphic);
			
			value = 1.2;
			
			cs.x = 48;
			cs.y = 85;
			cs.graphics.beginFill(0xFF0000);
			cs.graphics.drawCircle(0, 0, 20);
			cs.graphics.endFill();
			cs.alpha = 0;
			
			addChild(cs);
		}
		
		override public function pause():void
		{
			super.pause();
			myMovie.stop();
		}
		
		override public function resume():void
		{
			super.resume();
			if (isAttacking())
				myTween.pause();
			myMovie.play();
		}
		
		override public function destroy():void
		{
			super.destroy();
			myMovie.die();
			TweenMax.to(shadow, 1, { alpha: 0 });
		}
		
		override public function move():void
		{
			super.move();
			myMovie.walk();
		}
		
		override public function attack():void
		{
			super.attack();
			myMovie.attack();
		}
	}
}